//package com.sw.fileServer.utils.ppt;
//
//import com.aspose.slides.License;
//import com.aspose.slides.Presentation;
//import com.aspose.slides.SaveFormat;
//import com.aspose.words.FontSettings;
//import com.sw.fileServer.utils.OSUtils;
//import com.sw.fileServer.utils.excel.ExcelConvertPdfUtil;
//import lombok.extern.log4j.Log4j2;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.FileOutputStream;
//import java.io.InputStream;
//import java.util.Locale;
//
///**
// * ppt转pdf工具类
// *
// * @date 2023/10/23 18:40
// */
//@Log4j2
//public class PptConvertPdfUtil {
//
//    public static boolean getLicense() {
//        boolean result = false;
//        try {
//            //  license.xml应放在.
//            InputStream is = ExcelConvertPdfUtil.class.getClassLoader().getResourceAsStream("license.xml");
//            License aposeLic = new License();
//            aposeLic.setLicense(is);
//            result = true;
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return result;
//    }
//
//    public static void ppt2Pdf(String inPath,String outPath){
//        Locale locale = new Locale("zh", "cn");
//        Locale.setDefault(locale);
//        // 验证License 去除水印
//        if (!getLicense()) {
//            return ;
//        }
//        long start = System.currentTimeMillis();
//        try {
//            FileInputStream fileInput = new FileInputStream(inPath);
//            Presentation pres = new Presentation(fileInput);
//            FileOutputStream out = new FileOutputStream(new File(outPath));
//            pres.save(out, SaveFormat.Pdf);
//            out.close();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        long end =System.currentTimeMillis();
//        // 转化用时
//        log.info("pdf转换成功，共耗时：{}" , ((end - start) / 1000.0) + "秒");
//
//    }
////    public static void main(String[] args) {
////        String inputPath = "/Users/sckj/Desktop/111.pptx";
////        String outputPdfPath = "/Users/sckj/Desktop/111ppt.pdf";
////
////        ppt2Pdf(inputPath,outputPdfPath);
////    }
//
//}
